import {proRequest} from "../../request"
interface trademarkList {
    "records":recordsData [],
    "total": number,
    "size": number,
    "current": number,
    "searchCount": boolean,
    "pages": number
}
interface recordsData {
    "id": number,
    "tmName":string,
    "logoUrl":string
}
interface trademarkData {
  id?:number,
  logoUrl:string,
  tmName:string
}
export const getTrademark = async(page:number,limit:number)=>{
  return  await proRequest.get<any,trademarkList>(`/admin/product/baseTrademark/${page}/${limit}`)
}

export const saveTradmark = async(trademark:trademarkData)=>{
  // console.log(trademark);
  if (trademark.id) {
    console.log(trademark);
    
    
    return await proRequest.put<any,null>("/admin/product/baseTrademark/update",trademark)
  }
  return await proRequest.post<any,null>("/admin/product/baseTrademark/save",trademark)
}

export const removeTrademark = async(id:number)=>{
  return await proRequest.delete<any, null>(`/admin/product/baseTrademark/remove/${id}`)
}